fn if_let() {
    let favorite_color: Option<&str> = None;
    let is_tuesday = false;
    let age: Result<u8, _> = "34".parse();
    if let Some(color) = favorite_color {
        println!("favorite_color的some值{:?}", favorite_color)
    } else if is_tuesday {
        println!("is_tuesday星期二");
    } else if let Ok(age) = age {
        if age > 30 {
            println!("大于35")
        } else {
            println!("小于35")
        }
    } else {
        println!("外层else")
    }
    let favorite_color: Option<&str> = None;
    let is_tuesday = false;
    let age: Result<u8, _> = "34".parse();
    if let Some(color) = favorite_color {
        println!("favorite_color的some值{:?}", favorite_color)
    } else if is_tuesday {
        println!("is_tuesday星期二");
    } else if let Ok(age) = age {
        if age > 30 {
            println!("大于35")
        } else {
            println!("小于35")
        }
    } else {
        println!("外层else")
    }
}
fn while_let() {
    let mut stack: Vec<i32> = Vec::new();
    stack.push(1);
    stack.push(2);
    stack.push(3);
    while let Some(val) = stack.pop() {
        println!("val{}", val);
    }
}
fn for_enum() {
    let v = vec!["a", "b", "c"];
    for (index, value) in v.iter().enumerate() {
        println!("index{},value{}", index, value);
    }
}
fn main() {
    for_enum()
    // while_let()
}
//while let 条件循环
